﻿namespace Hotel.Managment.InMemoryPersistence
{
    using System.Collections.Generic;
    using System.Linq;
    using Common.Persistence;
    using Model;

    public abstract class Repository<T> : IRepository<T> where T : ModelEntity
    {
        protected abstract IList<T> Entities { get; } 
        
        public T Get(int id)
        {
            return this.Entities.Single(o => o.Id == id);
        }
    }
}